import { createRoot } from "react-dom/client";
import { client } from "../apollo.config";
import { ApolloProvider } from "@apollo/client";
import { Suspense } from "react";
import App from "./App";
import "./assets/css/entire.css";
import { theme } from "./assets/theme";
import { ThemeProvider } from "styled-components";
import { BrowserRouter } from "react-router-dom";
import Loading from "./baseUI/loading";
import { Provider } from "react-redux";
import store from "./store";

createRoot(document.getElementById("root")!).render(
  <BrowserRouter>
    <ApolloProvider client={client}>
      <Suspense fallback={<Loading />}>
        <ThemeProvider theme={theme}>
          <Provider store={store}>
            <App />
          </Provider>
        </ThemeProvider>
      </Suspense>
    </ApolloProvider>
  </BrowserRouter>
);
